<template>
	<div class="detail">
		<mt-header fixed :title="title">
		  <router-link to="/" slot="left">
			<mt-button icon="back">返回</mt-button>
		  </router-link>
		  <!-- <mt-button icon="more" slot="right"></mt-button> -->
		</mt-header>
		<div class="cont" v-html="html"></div>
	</div>
</template>

<script>
import { Indicator } from 'mint-ui';
export default{
	data(){
		return{
			title:"",
			html:""
		}
	},
	mounted(){
		//loading
		Indicator.open();
		//获取query
		let cat = this.$route.query.cat;
		this.title = this.$route.query.title;
		
		/* 图片壁报 */
		if(cat == 'hyzl'){
			location.href = "hyzlframe/t1.html"
			return
		}
		
		/* 视频资料 */
		if(cat == 'spzl'){
			location.href = "video/index.html"
			return
		}
		
		//图文数据
		this.$http.get(`detail/${cat}.htm`).then(res=>{
			Indicator.close();	//关闭loading
			this.html = res.data
		}).catch(err=>{
			Indicator.close();	//关闭loading
			Toast({
				message: "服务器请求失败",
				duration: 1000
			})
		})
		
	}
}
</script>

<style lang="scss">
	.detail{
		.cont{
			margin-top:50px;
			font-size: .85rem;
			text-align: left;
			p{
				padding:0;
				margin: 15px;
			}
			img{
				width: 100%;
				height: auto;
			}
			a{
				color: #26a2ff;
				text-decoration: underline;
			}
		}
	}
</style>
